package com.retailcloud.thirdpartyservice.controller;

import com.retailcloud.commonutils.annotation.SysLog;
import com.retailcloud.commonutils.utils.R;
import com.retailcloud.thirdpartyservice.service.OcrService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author wudi
 * @date 2024/11/2
 * @comment
 */
@RestController
@RequestMapping("aliOcr")
public class AliOcrController {

    @Resource
    private OcrService ocrService;


    @SysLog("调用了OCR识别")
    @RequestMapping("/getTxt")
    public R getTxt(@RequestBody Map<String, String> param) {
        Map<String, String> urlMap = ocrService.getTxt(param.get("url"));
        return R.ok().put("data", urlMap);
    }


}
